﻿CREATE PROCEDURE [dbo].[GetTotalProjectHours]
@startDate DATETIME, @endDate DATETIME
AS
SELECT     Projects.Name, SUM(EntryLog.Duration) AS Hours
FROM         EntryLog INNER JOIN
                      Projects ON EntryLog.ProjectID = Projects.ProjectID
WHERE     (EntryLog.EntryDate BETWEEN @startDate AND @endDate)
GROUP BY Projects.Name, Projects.ProjectTypeID


